<?php
$ma_nganh=$_GET['manganh'];
$ma_donvi=$_GET['donvi'];
$namkhoahoc=$_GET['namkhoahoc'];
include('../../configs/connect.php');   
 mysql_query("SET NAMES 'UTF8'");
 
    $sql="  SELECT  ma_lop,ten_lop 
            From    tbl_donvi_ctdt,tbl_ctdt,tbl_khoahoc,tbl_lop
            WHERE   tbl_donvi_ctdt.ma_ctdt=tbl_ctdt.ma_ctdt
            AND     tbl_donvi_ctdt.id_dv_ctdt=tbl_khoahoc.id_dv_ctdt
            AND     tbl_khoahoc.id_khoahoc=tbl_lop.id_khoahoc
            AND     tbl_lop.ma_donvi='$ma_donvi'
            AND     nam_khoahoc= '$namkhoahoc'
            AND     madm_nganh = '$ma_nganh' ";

$q=mysql_query($sql);
echo mysql_error();
echo "<select name='lop' id='lop' onchange='xetdssvlop()'>";
echo "<option value='0'>-------Chọn lớp-------</option>";
while($nt=mysql_fetch_array($q)){   
    echo "<option id='chonlop' name='chonlop' value=".$nt['ma_lop'].">".$nt['ten_lop']."</option>";
}
echo "</select>";

?>